<template>
	<view class="container ">
		<!--微信浏览器  -->
		<view v-if="isWxin" class="w100 flex-aro-x mt20">
			<view class="w70 topLeft flex-aro-x">
	<!-- 			<image src="../../static/logo.png" style="width: 120rpx;height: 120rpx;"></image> -->
				<image src="https://www.52yuze.cn/logo.png" style="width: 120rpx;height: 120rpx;"></image>
				<view class="iconright flex-xy">
					<view>
						下载应用，请点击右上角按钮,选择
						<text class="coOrange"><在浏览器中打开></text>
					</view>
				</view>
			</view>
			<view class="w10"><image src="../../static/download/arrow1.png" mode="widthFix" class="w100"></image></view>
		</view>
		<view v-if="isWxin" class="flex-xy">
			<!-- <image src="../../static/logo.png" style="width: 200rpx;height: 200rpx;"></image> -->
				<image src="https://www.52yuze.cn/logo.png" style="width: 120rpx;height: 120rpx;"></image>
			<view class="fs50w mb30">应用下载</view>
			<view class="w80">
				<u-button type="success" @click="isWxinClick">
					<image v-if="isAndroid" src="../../static/download/android.png" style="width: 40rpx;height: 40rpx;" class="mr20"></image>
					<image v-if="!isAndroid" src="../../static/download/ios.png" style="width: 40rpx;height: 40rpx;" class="mr20"></image>
					<text>立即下载</text>
				</u-button>
			</view>

			<view v-if="isAndroid" class="w100 flex-xy">
				<!-- <image src="../../static/androidShare.png" style="width: 400rpx;height: 400rpx;" class="mt30"></image> -->
				<image src="https://www.52yuze.cn/ercode.png" style="width: 400rpx;height: 400rpx;" class="mt30"></image>
				<view>长按二维码可识别或保存在本地</view>
				<view></view>
			</view>
			<view class="w100 flex-xy fs30w mt20" v-if="!!userId">推荐码:{{ userId }}</view>
		</view>

		<!-- 非微信浏览器    安卓-->
		<view v-if="!isWxin && isAndroid" class="flex-xy container containerH">
			<view class="w100 flex-xy">
				<!-- <image src="../../static/logo.png" style="width: 200rpx;height: 200rpx;"></image> -->
					<image src="https://www.52yuze.cn/logo.png" style="width: 120rpx;height: 120rpx;"></image>
				<view class="fs50w mb30">应用下载</view>
				<view class="w80">
					<u-button type="success" @click="isAndroidClick">
						<image src="../../static/download/android.png" style="width: 40rpx;height: 40rpx;" class="mr20"></image>
						<text>立即下载</text>
					</u-button>
				</view>
				<!-- <view class="w100 flex-xy fs30w mt20" v-if="!!userId">推荐码:{{ userId }}</view> -->
				<view v-if="isAndroid" class="w100 flex-xy">
					<!-- <image src="../../static/androidShare.png" style="width: 400rpx;height: 400rpx;" class="mt30"></image> -->
						<image src="https://www.52yuze.cn/ercode.png" style="width: 400rpx;height: 400rpx;" class="mt30"></image>
					<view>长按二维码可识别或保存在本地</view>
					<view></view>
				</view>
				<view class="w100 flex-xy fs30w mt20" v-if="!!userId">推荐码:{{ userId }}</view>
			</view>
		</view>

		<!-- 非微信浏览器    苹果设备-->
		<view v-if="!isWxin && !isAndroid" class="flex-xy container containerH">
			<view class="w100 flex-xy">
				<!-- <image src="../../static/logo.png" style="width: 200rpx;height: 200rpx;"></image> -->
					<image src="https://www.52yuze.cn/logo.png" style="width: 120rpx;height: 120rpx;"></image>
				<view class="fs50w mb30">应用下载</view>
				<view class="w80">
					<u-button type="success" @click="isIosClick">
						<image src="../../static/download/ios.png" style="width: 40rpx;height: 40rpx;" class="mr20"></image>
						<text>立即下载</text>
					</u-button>
				</view>
				<view v-if="!isAndroid" class="w100 flex-xy">
					<!-- <image src="../../static/androidShare.png" style="width: 400rpx;height: 400rpx;" class="mt30"></image> -->
						<image src="https://www.52yuze.cn/ercode.png" style="width: 400rpx;height: 400rpx;" class="mt30"></image>
					<view>长按二维码可识别或保存在本地</view>
					<view></view>
				</view>
				<view class="w100 flex-xy fs30w mt20" v-if="!!userId">推荐码:{{ userId }}</view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			isWxin: true, //true  微信浏览器  false  非微信浏览器
			isAndroid: true, //true  安卓  false  苹果设备
			userId: null
		};
	},
	onShow() {
		var isWxin = this.util.isWxin();
		var isAndroid = this.util.isAndroid();

		this.isWxin = isWxin;
		this.isAndroid = isAndroid;
		
		
		
	},
	onLoad(e) {
		console.log(e);
		var userId = e.userId;
		this.userId = userId;
	},
	methods: {
		isWxinClick() {
			uni.showToast({
				icon: 'none',
				title: '请在浏览器中下载！'
			});
		},
		isAndroidClick() {
			// window.location.href = 'http://www.52yuze.cn/app.apk';
			// window.location.href = 'http://www.52yuze.cn/app.apk';
			window.location.href = 'https://a.app.qq.com/o/simple.jsp?pkgname=com.mmparty.live';
		},
		isIosClick() {
			window.location.href = 'https://testflight.apple.com/join/YjfLc8Ah';
		}
	}
};
</script>

<style lang="scss" scoped>
page {
	background: #ffffff;
}
.topLeft {
	background: #f2f6ff;
	height: 150rpx;
	border-radius: 20rpx;
}
.iconright {
	width: calc(100% - 160rpx);
	height: 120rpx;
}
</style>
